import React, { useEffect } from 'react';
import { ConfigProvider } from 'antd';
import useThemeStore from '../store/themeStore';

const ThemeProvider = ({ children }) => {
  const { primaryColor } = useThemeStore();

  // 设置 Ant Design 主题
  const theme = {
    token: {
      colorPrimary: primaryColor,
    },
  };

  return (
    <ConfigProvider theme={theme}>
      {children}
    </ConfigProvider>
  );
};

export default ThemeProvider; 